function disp(This)
% disp  [Not a public function] Display method for model objects.
%
% Backend IRIS function.
% No help provided.

% -IRIS Toolbox.
% -Copyright (c) 2007-2015 IRIS Solutions Team.

%--------------------------------------------------------------------------

isEmpty = isempty(This.Assign);
if This.IsLinear
    type = 'linear';
else
    type = 'nonlinear';
end

if isEmpty
    fprintf('\tempty %s model object\n',type);
    doPrintNEqtn();
else
    nAlt = size(This.Assign,3);
    fprintf('\t%s model object: [%g] parameterisation(s)\n',type,nAlt);
    doPrintNEqtn();
    doPrintSolution();
end

disp@userdataobj(This);
disp(' ');


% Nested functions...


%**************************************************************************

    
    function doPrintNEqtn()
        n = [ ...
            sum(This.eqtntype == 1), ...
            sum(This.eqtntype == 2), ...
            sum(This.eqtntype == 3 & ~cellfun(@isempty,This.eqtn)), ...
            sum(This.eqtntype == 4), ...
        	sum(This.eqtntype == 5), ...
        ];
        fprintf('\tnumber of equations: [%g %g %g %g %g]\n',n);
    end % doPrintNEqtn()


%**************************************************************************
    
    
    function doPrintSolution()
        [~,inx] = isnan(This,'solution');
        nSolution = sum(~inx);
        fprintf('\tsolution(s) available: [%g] parameterisation(s)\n', ...
            nSolution);
    end % doPrintSolution()


end
